using System.Collections.Generic;

namespace ActiveRecordSample.Entities
{
	// Business class Product generated from Product
	// shvadskd [2008-10-20] Created

	using System;
	using System.ComponentModel;
	using Castle.ActiveRecord;

   [ActiveRecord("SalesLT.Product")]
	public  class Product 
		: ActiveRecordValidationBase<Product> 
	{

		#region Property_Names

		public static string Prop_ProductID = "ProductID";
		public static string Prop_Name = "Name";
		public static string Prop_ProductNumber = "ProductNumber";
		public static string Prop_Color = "Color";
		public static string Prop_StandardCost = "StandardCost";
		public static string Prop_ListPrice = "ListPrice";
		public static string Prop_Size = "Size";
		public static string Prop_Weight = "Weight";
		public static string Prop_ProductCategory = "ProductCategory";
		public static string Prop_ProductModel = "ProductModel";
		public static string Prop_SellStartDate = "SellStartDate";
		public static string Prop_SellEndDate = "SellEndDate";
		public static string Prop_DiscontinuedDate = "DiscontinuedDate";
		public static string Prop_ThumbNailPhoto = "ThumbNailPhoto";
		public static string Prop_ThumbnailPhotoFileName = "ThumbnailPhotoFileName";
		public static string Prop_rowguid = "rowguid";
		public static string Prop_ModifiedDate = "ModifiedDate";

		#endregion

		#region Private_Variables

		private int _productid;
		private string _name;
		private string _productNumber;
		private string _color;
		private System.Decimal _standardCost;
		private System.Decimal _listPrice;
		private string _size;
		private System.Decimal? _weight;
		private ProductCategory _productCategory;		
		private DateTime _sellStartDate;
		private DateTime? _sellEndDate;
		private DateTime? _discontinuedDate;
		private byte[] _thumbNailPhoto;
		private string _thumbnailPhotoFileName;		
		private DateTime _modifiedDate;
	
		#endregion

		#region Constructors

		public Product()
		{
		}

		public Product(
			int p_productid,
			string p_name,
			string p_productNumber,
			string p_color,
			System.Decimal p_standardCost,
			System.Decimal p_listPrice,
			string p_size,
			System.Decimal? p_weight,
			ProductCategory p_productCategory,
			DateTime p_sellStartDate,
			DateTime? p_sellEndDate,
			DateTime? p_discontinuedDate,
			byte[] p_thumbNailPhoto,
			string p_thumbnailPhotoFileName,
			DateTime p_modifiedDate)
		{
			_productid = p_productid;
			_name = p_name;
			_productNumber = p_productNumber;
			_color = p_color;
			_standardCost = p_standardCost;
			_listPrice = p_listPrice;
			_size = p_size;
			_weight = p_weight;
			_productCategory = p_productCategory;			
			_sellStartDate = p_sellStartDate;
			_sellEndDate = p_sellEndDate;
			_discontinuedDate = p_discontinuedDate;
			_thumbNailPhoto = p_thumbNailPhoto;
			_thumbnailPhotoFileName = p_thumbnailPhotoFileName;			
			_modifiedDate = p_modifiedDate;
		}

		#endregion

		#region Properties

		[PrimaryKey("ProductID", Access = PropertyAccess.NosetterLowercaseUnderscore)]
		public int ProductID
		{
			get { return _productid; }
		}

		[Property("Name", NotNull = true, Length = 50)]
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		[Property("ProductNumber", NotNull = true, Length = 25)]
		public string ProductNumber
		{
			get { return _productNumber; }
			set { _productNumber = value; }
		}

		[Property("Color", Length = 15)]
		public string Color
		{
			get { return _color; }
			set { _color = value; }
		}

		[Property("StandardCost", NotNull = true)]
		public System.Decimal StandardCost
		{
			get { return _standardCost; }
			set { _standardCost = value; }
		}

		[Property("ListPrice", NotNull = true)]
		public System.Decimal ListPrice
		{
			get { return _listPrice; }
			set { _listPrice = value; }
		}

		[Property("Size", Length = 5)]
		public string Size
		{
			get { return _size; }
			set { _size = value; }
		}

		[Property("Weight")]
		public System.Decimal? Weight
		{
			get { return _weight; }
			set { _weight = value; }
		}

		[BelongsTo("ProductCategoryID", Type = typeof(ProductCategory))]
		public ProductCategory ProductCategory
		{
			get { return _productCategory; }
			set { _productCategory = value; }
		}		

		[Property("SellStartDate", NotNull = true)]
		public DateTime SellStartDate
		{
			get { return _sellStartDate; }
			set { _sellStartDate = value; }
		}

		[Property("SellEndDate")]
		public DateTime? SellEndDate
		{
			get { return _sellEndDate; }
			set { _sellEndDate = value; }
		}

		[Property("DiscontinuedDate")]
		public DateTime? DiscontinuedDate
		{
			get { return _discontinuedDate; }
			set { _discontinuedDate = value; }
		}

		[Property("ThumbNailPhoto")]
		public byte[] ThumbNailPhoto
		{
			get { return _thumbNailPhoto; }
			set { _thumbNailPhoto = value; }
		}

		[Property("ThumbnailPhotoFileName", Length = 50)]
		public string ThumbnailPhotoFileName
		{
			get { return _thumbnailPhotoFileName; }
			set { _thumbnailPhotoFileName = value; }
		}

		[Property("ModifiedDate", NotNull = true)]
		public DateTime ModifiedDate
		{
			get { return _modifiedDate; }
			set { _modifiedDate = value; }
		}
   
		#endregion

	} // Product
}

